from typing import *
class Solution:
    def minLengthAfterRemovals(self, nums: List[int]) -> int:
        cnt = Counter(nums)
        mx = 0
        for k,v in cnt.items():
            if v > mx:
                mx = v
        if mx <= len(nums) // 2:
            return len(nums) & 1
        return mx * 2 - len(nums)
    
s = Solution()
print(s.minLengthAfterRemovals([1,1]))